home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
sc3x04.exe
/
GETNETSN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-05
|
3KB
|
69 lines
// IMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM;
// : :
// : module: getnetsn.c :
// : abstract: This module shows how to make 3.x system calls using :
// : the F2 Shell Interface for the Get Network Serial :
// : Number API, obviously it requires the NetWare Shell. :
// : :
// : environment: NetWare 3.x v3.11 :
// : Borland C 3.1 :
// : :
// : This software is provided as is and carries no warranty :
// : whatsoever. Novell disclaims and excludes any and all implied :
// : warranties of merchantability, title and fitness for a particular :
// : purpose. Novell does not warrant that the software will satisfy :
// : your requirements or that the software is without defect or error :
// : or that operation of the software will be uninterrupted. You are :
// : using the software at your risk. The software is not a product :
// : of Novell, Inc. or any of subsidiaries. :
// HMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM<
//
// ****** N O T I C E ******
//
// This software is considered pre-release and may be used at your own
// risk and has been provided due to the many requests of our cust-
// omers. Support for this module will be provided at the sole
// discretion of Novell, Inc.
//
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <conio.h>
#include <dos.h>
#include <fcntl.h>
#include <sys\types.h>
#include <sys\stat.h>
#include "nwsys.c"
struct {
WORD sflen; // length of the structure
BYTE sfcode; // the subfunction code
}Request;
struct {
LONG serverSerialNumber;
WORD applicationNumber;
}Reply;
int main()
{
int retCode, i;
Request.sflen = sizeof(Request);
Request.sfcode = 0x12;
retCode = NWSystemCall(0x17, &Request, sizeof(Request),
&Reply, sizeof(Reply));
if (retCode != 0) {
printf("Get Network Serial Number call failed. Retcode = %d\n",
retCode);
return(-1);
}
printf("Server serial number: 0x%lx, Application number: 0x%x\n",
DWordSwap(Reply.serverSerialNumber), WordSwap(Reply.applicationNumber));
return(0);
}